package org.hhchat.others.didi;

import java.util.Scanner;

/**
 * Created by hh23485 on 2017/9/10.
 */
public class exam03 {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] a = new int[n];
        for(int i=0;i<n;i++) {
            a[i]=scanner.nextInt();
        }
        if(n==1){
            System.out.println(1);
            return;
        }
        int count=0;
        for(int i=0;i<n;i++){
            for(int j=i+1;j<n;j++) {
                if(checkXor(a[i],a[j])){
                    count++;
                }
            }
        }
        System.out.println(count);
        return;
    }

    public static boolean checkXor(int l, int r){
        if(l==r){return true;}
        if(l<r){return false;}
        int x=l;
        for(int i=l+1;i<=r;i++){
            x ^= i;
        }
        return x==0;
    }
}
